package main

import (
	"fmt"

	"gitee.com/krio/grpc-common/cmd/app"
	"gitee.com/krio/grpc-common/cmd/lib"
	"gitee.com/krio/grpc-common/conf"
	"gitee.com/krio/grpc-common/dao"
	"github.com/gookit/color"
)

func main() {
	conf.Init()
	lib.InitLogger()
	lib.InitRedis()
	dao.InitDao()
	cmdPrint()
	app.Run()
}

// cmd打印参数
func cmdPrint() {
	color.Greenp(fmt.Sprintf("*[ logger: %s ]\n", conf.C.Logger.Level))
	color.Greenp(fmt.Sprintf("*[ redis: %s/%d ]\n", conf.C.Redis.Dsn, conf.C.Redis.DB))
	color.Greenp(fmt.Sprintf("*[ mysql: %s ]\n", conf.C.Mysql.URL))
	color.Greenp(fmt.Sprintf("*[ grpc: %d ]\n", conf.C.GRPC.Port))
}
